<?php
/**
 * @package		Joomla.Site
 * @subpackage	com_users
 * @copyright	Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 * @since		1.5
 */

defined('_JEXEC') or die;

JHtml::_('behavior.keepalive');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
?>
<div id="content-left">
	<h1>Glemt password</h1>            

</div><!--#content-left-->

<div id="content-right">
	<form class="f-forget-pass" id="user-registration" action="<?php echo JRoute::_('index.php?option=com_users&task=reset.checkSendMail'); ?>" method="post">
		<fieldset>
			<?php
				$article = JUtility::getArticle(35);
				echo $article->introtext;
			?>
			<div>
				<input type="text" id="email" name="email" value="Indtast din e-mail">
			</div>
			<div class="bnt-send2">
				<a href="javascript:void(0)" onclick="jQuery('#user-registration').submit();">Send</a>
			</div>
		</fieldset>
		<?php echo JHtml::_('form.token'); ?>
	</form>
</div><!--#content-right-->
<?php                        	       
$input_name = JText::_( 'Indtast din Navn' );
$input_phone = JText::_( 'Indtast din Telefon' );
$input_email = JText::_( 'Indtast din E-mail' );
$input_username = JText::_( 'Indtast din Brugernavn' );
$input_password = JText::_( 'Indtast din Kordeord' );
$input_password1 = JText::_( 'Indtast din Bekræft Kordeord' );
	
?>                        
 <script type="text/javascript">                   
jQuery(document).ready(function(jQuery) {
	jQuery.validator.addMethod('postalcode', function (value) { 
		if(value=='') return true;	
		return /^\d{4}$/.test(value); 
	   }, '');
	jQuery.validator.addMethod("notEqual", function(value, element, param) {
			return this.optional(element) || value !== param;
	});
		//jQuery("#postcode").mask("9999",{placeholder:""});  
		jQuery("#user-registration").validate(
			{
				errorPlacement: function(error, element) {			
			},
			invalidHandler: function(form, validator) {
			  var errors = validator.numberOfInvalids();
			if (errors) {
                //$('#alert').html(validator['errorList'][0]['message']);
				jQuery('#alert').html(validator['errorList'][0]['message']);
    			jQuery('#backoverlay').show();
    			jQuery('#show_popup').show();
            	jQuery('#f_focus').html(validator['errorList'][0]['element'].name);
				validator['errorList'][0]['element'].focus();
				
			  } else {
			  }
			},
			rules: {
						
				email:{
					required: true,
					email:true,
					notEqual: "Indtast din e-mail",
				},	
				
			},
			messages: {
				email: "<?php echo $input_email; ?>",
				
			
			}
		});
        close_popup=function(){		
			var fel=jQuery('#f_focus').html();
            jQuery('#backoverlay').hide();
    		jQuery('#show_popup').hide();
    		jQuery('#' + fel ).focus();		
      };
      
      
	});
</script>        
       
        

	
	
<?php return; ?>
<div class="reset<?php echo $this->pageclass_sfx?>">
	<?php if ($this->params->get('show_page_heading')) : ?>
	<h1>
		<?php echo $this->escape($this->params->get('page_heading')); ?>
	</h1>
	<?php endif; ?>

	<form id="user-registration" action="<?php echo JRoute::_('index.php?option=com_users&task=reset.request'); ?>" method="post" class="form-validate">

		<?php foreach ($this->form->getFieldsets() as $fieldset): ?>
		<p><?php echo JText::_($fieldset->label); ?></p>		<fieldset>
			<dl>
			<?php foreach ($this->form->getFieldset($fieldset->name) as $name => $field): ?>
				<dt><?php echo $field->label; ?></dt>
				<dd><?php echo $field->input; ?></dd>
			<?php endforeach; ?>
			</dl>
		</fieldset>
		<?php endforeach; ?>

		<div>
			<button type="submit" class="validate"><?php echo JText::_('JSUBMIT'); ?></button>
			<?php echo JHtml::_('form.token'); ?>
		</div>
	</form>
</div>
